Q on ioctl support in netfront/netback
Hello!!!
Our network driver support ioctl calls from applications for register reads/writes. I am wondering can ioctl calls be supported from domU to dom0? i.e call flow will be
application invokes ioctl ---> netfront ioctl ----->via xenbus ------> netback ioctl ------> to actual driver in dom0
with the return path in similar fashion.
Looked at the existing netfront and netback drivers and with my understanding it seems it is not possible. I looked at scsifront and scsiback, assuming storage drivers should be supporting ioctls, didn't see anything related to it. Wanted to know what's the mechanism to support ioctls. Inputs appreciated.
Thanks
-RK
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Quoted 7 lines · ravi kerur
Our network driver support ioctl calls from applications for register reads/writes. I am wondering can ioctl calls be supported from domU to dom0? i.e call flow will be
application invokes ioctl ---> netfront ioctl ----->via xenbus ------> netback ioctl ------> to actual driver in dom0
with the return path in similar fashion.
I'm wondering precisely what register in netback you wish to access?
Signature · 10 lines
=============================== Paul Durrant, Software Engineer Citrix Systems (R&D) Ltd. First Floor, Building 101 Cambridge Science Park Milton Road Cambridge CB4 0FY United Kingdom ===============================
Paul,
Registers are not in netback, they are h/w registers on NIC and the driver supports reads/writes via ioctl calls. Driver is in dom0 and application which reads/writes registers is run in domU.
-RK
Quoted 19 lines · Paul Durrant
Quoted 11 lines · ravi kerur
Our network driver support ioctl calls from applications for register reads/writes. I am wondering can ioctl calls be supported from domU to dom0? i.e call flow will be
application invokes ioctl ---> netfront ioctl ----->via xenbus ------> netback ioctl ------> to actual driver in dom0
with the return path in similar fashion.
I'm wondering precisely what register in netback you wish to access?
--
===============================
Paul Durrant, Software Engineer
Quoted 8 lines
Citrix Systems (R&D) Ltd.
First Floor, Building 101
Cambridge Science Park
Milton Road
Cambridge CB4 0FY
United Kingdom
===============================
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Quoted 5 lines · ravi kerur
Paul,
Registers are not in netback, they are h/w registers on NIC and the driver supports reads/writes via ioctl calls. Driver is in dom0 and application which reads/writes registers is run in domU.
You could use PCI passthrough. This way the NIC would be visible in your DomU and you could fiddle with the registers.
Hi Konrad,
Using PCI passthrough(I believe it is via config file changes) prevents other domU's accessing the NIC correct? If I use it, would the network transmit/receive still happen via netfront/netback drivers?
Thanks
-RK
Quoted 11 lines · Konrad Rzeszutek Wilk
Quoted 3 lines · ravi kerur
Paul,
Registers are not in netback, they are h/w registers on NIC and the
driver
Quoted 2 lines
supports reads/writes via ioctl calls. Driver is in dom0 and application which reads/writes registers is run in domU.
You could use PCI passthrough. This way the NIC would be visible in your DomU and you could fiddle with the registers.
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Quoted 6 lines · ravi kerur
Hi Konrad,
Using PCI passthrough(I believe it is via config file changes) prevents other domU's accessing the NIC correct? If I use it, would the network transmit/receive still happen via netfront/netback drivers?
No. If you use PCI passthrough then the domU uses the real driver for the nic that would also be used on baremetal or in dom0.
PCI passthrough for a NIC is only possible to one/single domU, per PCI device.
(Some multiport NICs show up as a multiple PCI devices, which allows you to passthrough different ports to different domUs).
-- Pasi
Quoted 27 lines
Thanks
-RKOn Tue, Feb 16, 2010 at 10:14 AM, Konrad Rzeszutek Wilk <[1][email protected]> wrote:
On Mon, Feb 15, 2010 at 07:54:02AM -0800, ravi kerur wrote:
> Paul,
>
> Registers are not in netback, they are h/w registers on NIC and the driver
> supports reads/writes via ioctl calls. Driver is in dom0 and application
> which reads/writes registers is run in domU.You could use PCI passthrough. This way the NIC would be visible in your DomU and you could fiddle with the registers.
References
Visible links
1. mailto:[email protected]_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Quoted 4 lines · ravi kerur
Hi Konrad,
Using PCI passthrough(I believe it is via config file changes) prevents other domU's accessing the NIC correct? If I use it, would the network
That is correct.
Quoted 1 line
transmit/receive still happen via netfront/netback drivers?
If you have two NICs, where one of them is PCI passthrough and the other dedicated to the guests, then the second can serve as netback/netfront.
Thought I wonder if you can have the netback in the guest. This way you could fiddle with your registers in one domain, and export a network interface (vif) to the other guests from the domain that owns the PCI device.
Hi Konrad, Pasi
Thanks for your inputs. Looks like we(our team) needs to take a step back and evaluate this and other things we have discovered in the past few days. We will get back to you with more questions.
Thanks
-RK
Quoted 10 lines · Konrad Rzeszutek Wilk
Quoted 4 lines · ravi kerur
Hi Konrad,
Using PCI passthrough(I believe it is via config file changes) prevents other domU's accessing the NIC correct? If I use it, would the network
That is correct.
Quoted 1 line
transmit/receive still happen via netfront/netback drivers?
Quoted 9 lines
If you have two NICs, where one of them is PCI passthrough and the other dedicated to the guests, then the second can serve as netback/netfront.
Thought I wonder if you can have the netback in the guest. This way you could fiddle with your registers in one domain, and export a network interface (vif) to the other guests from the domain that owns the PCI device.
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Quoted 5 lines · ravi kerur
Paul,
Registers are not in netback, they are h/w registers on NIC and the driver supports reads/writes via ioctl calls. Driver is in dom0 and application which reads/writes registers is run in domU.
Why do you want to map or preserve some register interface?
Is this some sort of hardware multiplex? As Konrad pointed out, in that case a PV driver is probably the wrong approach altogether.
If what you want is just a bunch of extended control plane attributes, rather consider mapping them to xenstore.
That's slightly more asynchronous and probably not a great option if you need a synchronous interface. Especially if you need individual return values, not just a bunch of fields to write into.
If the latter case, next option would be some dedicated shared memory structure. But it's hard to imagine something like that to make sense. :}
Daniel
Hi Daniel,
These registers are(DMA, statistics, and other h/w related to NIC), I just want to read those registers and in very few cases write to them. Currently, I can run those applications in dom0 and access directly but I wanted to check if anything is possible from domU? Other thing I tried using sockets from domU to dom0(albeit I had clear firewall settings in dom0) but Citrix support forum mentioned it is not the recommended way. I am not sure whether I answered your question, let me know if you need additional info.
Thanks
-RK
Quoted 19 lines · Daniel Stodden
Quoted 5 lines · ravi kerur
Paul,
Registers are not in netback, they are h/w registers on NIC and the driver supports reads/writes via ioctl calls. Driver is in dom0 and application which reads/writes registers is run in domU.
Why do you want to map or preserve some register interface?
Is this some sort of hardware multiplex? As Konrad pointed out, in that case a PV driver is probably the wrong approach altogether.
If what you want is just a bunch of extended control plane attributes, rather consider mapping them to xenstore.
That's slightly more asynchronous and probably not a great option if you need a synchronous interface. Especially if you need individual return values, not just a bunch of fields to write into.
Quoted 7 lines
If the latter case, next option would be some dedicated shared memory structure. But it's hard to imagine something like that to make sense. :}
Daniel
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel